package com.example.sample.activity;

import android.os.Bundle;
import android.os.Environment;
import android.widget.TextView;

import com.example.app.BaseActivity;

/**
 * Created by liangy on 2016/9/29.
 */
public class DirActivity extends BaseActivity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        TextView tv = new TextView(this);
        setContentView(tv);
        String text = getText();
        tv.setText(text);
    }

    private String getText(){
        String result = "";
        String item, name, value;

        name = "getExternalCacheDir()=";
        value = getExternalCacheDir().getPath();
        item = name + value + "\n";
        result += item;

        name = "getExternalFileDir(Environment.DIRECTORY_DCIM)=";
        value = getExternalFilesDir(Environment.DIRECTORY_DCIM).getPath();
        item = name + value + "\n";
        result += item;

        name = "getFilesDir()=";
        value = getFilesDir().getPath();
        item = name + value + "\n";
        result += item;

        name = "getCacheDir=";
        value = getCacheDir().getPath();
        item = name + value + "\n";
        result += item;

        name = "Environment.getExternalStorageDirectory=";
        value = Environment.getExternalStorageDirectory().getPath();
        item = name + value + "\n";
        result += item;

        return result;
    }
}
